@echo off

git pull

echo 1.install and build gitbook
call rmdir /s /q _book
rem call gitbook install
call gitbook build

echo 2.delete unused file
rmdir /s /q ".\_book\config"
rmdir /s /q ".\_book\import"
rmdir /s /q ".\_book\source"
del ".\_book\*.bat"

for /r ".\_book\markdown" %%i in (*.md) do (
    del "%%i"
    echo Deleted: %%i
)

echo 3.commit to gitee remote
git add .
git commit -m "update"
git push

echo Done!